package com.hyt.it.ogt.ks.feign.es;

import java.util.List;

import com.hyt.it.ogt.ks.es.CandidateOperationTrackLogDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import com.hyt.it.ogt.ks.feign.model.es.EsApplyCheckRecord;
import com.hyt.it.ogt.ks.feign.model.es.EsExceptionManageRecord;

/**
 * es服务调用失败处理类
 *
 * @author zhoumiao
 * @since 2022/11/24 13:44
 */
@FeignClient(name = "it-ogt-log${log.tag:}", fallbackFactory = EsClientFallbackFactory.class)
public interface EsClient {
    /**
     * 保存或者更新异常操作到es
     *
     * @param exceptionManageRecord 异常操作
     */
    @PutMapping(value = "/exceptionManageRecord/saveOrUpdate")
    void saveOrUpdate(@RequestBody EsExceptionManageRecord exceptionManageRecord);

    /**
     * 通过异常操作表id删除es中异常操作
     *
     * @param ids candidate_log_other表id
     */
    @DeleteMapping("/exceptionManageRecord")
    void delete(@RequestBody List<String> ids);

    /**
     * 指定删除多少天之前的数据
     *
     * @param beforeDays 指定天数
     */
    @PostMapping("/exceptionManageRecord/deleteByBeforeDays")
    void deleteLogOtherByBeforeDays(@RequestParam Integer beforeDays);

    /**
     * 新增或者保存学生异常审核记录
     *
     * @param esApplyCheckRecord
     */
    @PutMapping(value = "/applyCheck/saveOrUpdate")
    void saveOrUpdate(@RequestBody EsApplyCheckRecord esApplyCheckRecord);

    /**
     * 考生异常管理审核删除
     *
     * @param ids
     */
    @DeleteMapping("/applyCheck")
    void deleteApplyCheck(@RequestBody List<String> ids);

    /**
     * 指定删除多少天之前的数据
     *
     * @param beforeDays 指定天数
     */
    @PostMapping("/applyCheck/deleteByBeforeDays")
    void deleteApplyCheckByBeforeDays(@RequestParam Integer beforeDays);

    /**
     * 保存考生行为轨迹
     * @param candidateOperationTrackLogList
     */
    @PutMapping("/candidateOperationTrackLog/save")
    void saveCandidateOperationTrackLog(@RequestBody List<CandidateOperationTrackLogDTO> candidateOperationTrackLogList);

    /**
     * 异步保存考生行为轨迹
     * @param candidateOperationTrackLogList
     */
    @PutMapping("/candidateOperationTrackLog/asyncSave")
    void asyncSaveCandidateOperationTrackLog(@RequestBody List<CandidateOperationTrackLogDTO> candidateOperationTrackLogList);

    /**
     * 根据考试ID删除考生轨迹
     * @param examId
     */
    @DeleteMapping("/candidateOperationTrackLog/deleteCandidateOperationTrackLogByExamId/{examId}")
    void deleteCandidateOperationTrackLogByExamId(@PathVariable String examId);

    /**
     * 删除考生轨迹
     */
    @DeleteMapping("/candidateOperationTrackLog/deleteCandidateOperationTrackLogAll")
    void deleteCandidateOperationTrackLogAll();

}
